<?php if ( ! defined('BASEPATH')) exit('This file does not run directly. Sorry.'); ?>
<?php
/**
 * Kalaisoo.
 *
 * A lightweight no-framework framework written in PHP.
 *
 * @package Kalaisoo
 * @author $Author: info@sah-company.com $
 */
?>
<section class="form">
	<header>
		<h1><?php echo __($record->getMeta('type')),' ',$record->view(); ?></h1>
		<?php
		/**
		 * Include the partial template that displays the tools.
		 */
		$this->view('shared/editor/toolbar');
		?>
	</header>
<?php
/**
 * output the form
 */
//echo formOpen('editor', $url, array('enctype' => 'multipart/form-data', 'autocomplete' => 'off'));
?>
<form id="editor" method="post" action="<?php echo $url; ?>" enctype="multipart/form-data" autocomplete="off" accept-charset="utf-8">
	<fieldset>
		<legend><?php echo __($record->getMeta('type').'_legend'); ?></legend>
<?php
//$stack = formGestalt($record->gestalt(), $record, $prefix = $record->getMeta('type'), $record);
/**
 * Display a special or scaffolded form for the current record
 */
if ($ret = $record->view('editor_'.$toolbar['current'], $this->data)):
	echo $ret;
else:
	echo $gestalt->output();
endif;
?>
	</fieldset>
	<fieldset>
		<legend><?php echo __('buttons'); ?></legend>
			<input type="submit" name="submit" value="<?php echo $submit; ?>" id="submit" class="button default <?php echo $toolbar['current']; ?>" />
<?php
/**
 * If there is an secondary submit button defined, display it
 */
if (isset($secondary_submit)):
?>
			<input type="submit" name="submit" value="<?php echo $secondary_submit; ?>" id="secondary_submit" class="button secondary" />
<?php
endif;
?>
	</fieldset>
</form>
	<footer>
		<small>
<?php
echo $record->info($entry);
?>
		</small>
	</footer>
</section>